import request from '@/utils/request'

// 获取wms材料出库单
export function getMaterialsOutboundInfo(query) {
  return request({
    url: '/materials-outbound',
    method: 'get',
    params: query
  });
}

// 获取NCC材料出库单
export function getMaterialsOutboundNccInfo(query) {
  return request({
    url: '/materials-outbound/ncc',
    method: 'get',
    params: query
  });
}


// +++废除材料出库单
export function deleteMaterialsOutbound(cgeneralhid, query) {
  return request({
    url: `/materials-outbound/${cgeneralhid}`,
    method: 'DELETE',
    params: query
  });
}



// 修改NCC材料出库单
export function createMaterialsOutboundUpdate(data) {
  return request({
    url: '/materials-outbound/update',
    method: 'post',
    data: JSON.stringify(data)
  });
}


// 对NCC材料出库单进行签字
export function updateMaterialsOutbound(cgeneralhid, data) {
  return request({
    url: `/materials-outbound/${cgeneralhid}`,
    method: 'PUT',
    data
  });
}


// 新增材料出库单据
export function createMaterialsOutbound(data) {
  return request({
    url: '/materials-outbound',
    method: 'post',
    data: JSON.stringify(data)
  });
}

// WMS确认NCC材料出库单
export function creatematerialsOutboundConfirm(data) {
  return request({
    url: '/materials-outbound/confirm',
    method: 'post',
    data: JSON.stringify(data)
  });
}

// 材料出库取消提取
export function createMaterialsOutboundBack(headerid) {
  return request({
    url: `/materials-outbound/back/${headerid}`,
    method: 'post',
  });
}

// 材料出库WMS下账
export function createMaterialsOutboundInventory(headerid) {
  return request({
    url: `/materials-outbound/inventory/${headerid}`,
    method: 'post',
  });
}